package com.mall.order.enums;

/**
 * 订单状态：0-待付款；1-待发货；2-已发货；3-已完成；4-已取消， 5-已退款
 *
 */
public enum OrderStatusEnum {

	/**
	 * 0-待付款
	 */
	PENDING_PAY(0, "待付款"),

	/**
	 * 1-待发货
	 */
	PENDING_SEND(1, "待发货"),
	
	/**
	 * 2-已发货
	 */
	YET_SEND(2, "待领取"),
	
	/**
	 * 3-已完成
	 */
	YET_COMPLETE(3, "已完成"),
	
	/**
	 * 4-已取消
	 */
	YET_CANCEL(4, "已取消"),

	/**
	 * 4-已取消
	 */
	YET_REFUND(5, "已退款");

	private int value;

	private String content;

	OrderStatusEnum(int value, String content) {
		this.value = value;
		this.content = content;
	}

	public int value() {
		return this.value;
	}

	public String content() {
		return this.content;
	}
	
	public static OrderStatusEnum getByValue(Integer value) {
		for (OrderStatusEnum type : values()) {
			if (type.value == value) {
				return type;
			}
		}
		return null;
	}

}
